/**
 * Copyright (C) 2012 The SkyTvOS Project
 * <p/>
 * Version     Date           Author
 * ─────────────────────────────────────
 * 2015年4月8日         Root.Lu
 */

package com.coocaa.x.service.litecontent.providers.system.host;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;

import com.coocaa.x.service.litecontent.LiteContentProvider;
import com.coocaa.x.service.litecontent.LiteContentProvider.LiteContentProviderHost;
import com.coocaa.x.service.litecontent.LiteContentProvider.ResourceHandler;
import com.coocaa.x.service.litecontent.data.ResultPackage;
import com.skyworth.framework.skycommondefine.SkyworthBroadcastKey;

public class SystemHost_Com_Coocaa_CC5X extends LiteContentProviderHost {
    private static SystemHost_Com_Coocaa_CC5X instance = null;

    public static synchronized void create(Context context, LiteContentProvider provider) {
        if (instance == null)
            instance = new SystemHost_Com_Coocaa_CC5X(context, provider);
    }

    private static final String MY_HOST = "com.coocaa.cc5x";

    public SystemHost_Com_Coocaa_CC5X(Context context, LiteContentProvider provider) {
        super(context, provider);
        // TODO Auto-generated constructor stub
    }

    @Override
    public String myHost() {
        return MY_HOST;
    }

    @SuppressWarnings("unused")
    // 2.2.1、信号源
    private ResourceHandler tv_source_list = new ResourceHandler(this, "/tv_source_list") {
        @Override
        public ResultPackage call(Uri uri) {
            ResultPackage rp = new ResultPackage();
            Intent intent = new Intent("startSourceList");
            intent.putExtra("specialKey", SkyworthBroadcastKey.SKY_BROADCAST_KEY_SIGNAL);
            mContext.sendBroadcast(intent);
            return rp;
        }
    };

}
